package everyday;

import org.junit.jupiter.api.Test;

public class T2427 {
    public int commonFactors(int a, int b) {
        int sum=0;
        for (int i = 1; i <=gdc(a,b) ; i++) {
            if (a%i==0&&b%i==0){
                sum++;
            }
        }
        return sum;
    }

    public int gdc(int a, int b) {
        if (b == 0) return a;
        int r = a % b;
        return gdc(b,r);
    }

    @Test
    public void test() {
        System.out.println(commonFactors(32, 408));
    }
}
